var huizongbiao = new Vue({
    el : '#Huizongbiaolist',
    data:{
        xiangmuId : $("#xiangmuId").val(),
        xiangmu : {},
        HuizongbiaoList : [],
        show : false,
        total:0,

    },
    created : function() {
        var _this = this;

        $(".nav navbar-nav li").removeClass("active");
        $("#nav_huizongbiao").addClass("active");
        _this.bindHuizongbiaoList();
        _this.bindXiangmu();
    },
    methods : {



        bindXiangmu:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/xiangmu/find_one', {
                xianmguid : _this.xiangmuId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        var data = ppData.resultContent;
                        _this.xiangmu = data;
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },

        bindHuizongbiaoList:function (){
            var _this = this;
            layer.open({type:3});
            $.post("/xinyaoshenqingjieguo/findHuizongbiaolist",{
                xiangmuid : _this.xiangmuId,

                rdm : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if (ppData != null){
                    if(ppData.result == "1"){
                        var data=ppData.resultContent;
                        var mmHtml = "<div class='table-head' style='height: 80px;'><table class=\"table table-hover table-bordered\" style=\"overflow:hidden; margin-bottom:10px;table-layout:fixed;\"  v-if=\"show\" cellspacing=\"0\" cellpadding=\"0\">\n" +
                            "   <thead >\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:40px;\" >排名</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:40px;\" >序号</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;\" >药品名称(通用名称)</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >规格包装</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >申请科室</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >专科组别</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >是否是基药</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >是否是创新药</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >是否是一、二线指南推荐</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >是否有临床基础</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >临采5次以上年份</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >品种同意数／总票数</th>\n" +

                            "    </thead></table></div><div class='table-body'><table><tbody>";
                        if(data.length > 0){
                            _this.show = true;
                            for (var i = 0; i < data.length; i++) {
                                var mmXinyaoshenqingOne = data[i];

                                var mmpaiming = i+1;
                                var mmpaixuhao = mmXinyaoshenqingOne.ordernumber;
                                var mmyaowumingcheng = mmXinyaoshenqingOne.yaopinmingcheng;
                                var mmguigebaozhuang = mmXinyaoshenqingOne.guigebaozhuang;
                                var mmshenqingkeshi = mmXinyaoshenqingOne.shenqingkeshi;
                                var mmzhuankezubie = mmXinyaoshenqingOne.zhuankezubie;
                                var mmshifoujiyao = mmXinyaoshenqingOne.shifoujiyao;
                                var mmshifouchuangxin = mmXinyaoshenqingOne.shifouchuangxin;
                                var mmshifouzhinan = mmXinyaoshenqingOne.shifouzhinan;
                                var mmshifoulinchuang = mmXinyaoshenqingOne.shifoulinchuang;
                                var mmlincainianfen = mmXinyaoshenqingOne.lincainianfen;
                                var mmpiaoshu = mmXinyaoshenqingOne.piaoshu;

                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:40px;'>" + mmpaiming + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:40px;'>" + mmpaixuhao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle'>" + mmyaowumingcheng + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmguigebaozhuang + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmshenqingkeshi + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmzhuankezubie + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmshifoujiyao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmshifouchuangxin + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmshifouzhinan + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmshifoulinchuang + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmlincainianfen + "</td>";
                                mmHtml +="<td style='text-align:center;vertical-align:middle;width: 100px;height: 100%'>" + mmpiaoshu + "</td>";

                                mmHtml += "</tr>";

                            }



                        }else {
                            _this.show = false;
                        }
                        mmHtml += "</table>";
                        $("#List").html(mmHtml);
                    }else{
                        layer.alert(ppData.message);
                    }
                }

            },"json");
        },



    },
    watch :{
        //监控分页情况，刷新列表
        pageIndex : function(){

            this.bindHuizongbiaoList();
        }
    }
})